/*
  请求地址:http://wthrcdn.etouch.cn/weather_mini
  请求方法:get
  请求参数:city(城市名)
  响应内容:天气信息

  1. 点击回车
  2. 查询数据
  3. 渲染数据
  */
var app = new Vue({
    el: '#app',
    data: {
        message: '',
        weatherLis: []
    },
    methods: {
        keyup: function() {
            var that = this;
            axios.get('http://wthrcdn.etouch.cn/weather_mini?city=' + this.message).then(function(success) {
                console.log(success);
                that.weatherLis = success.data.data.forecast;
            })
        },
        clickBut: function() {
            this.keyup();
        },
        clcikCity: function(city) {
            this.message = city;
            this.keyup();
        }
    }
})